<template>
  <div class="app-title">
    <div class="app-title-left" @click="goBack()">
      <!--返回-->
      <icon name="back" scale="3" v-if='back'></icon>
    </div>
    <span class="app-title-middle">{{title}}</span>
  </div>
</template>
<script>
export default {
  props: {
    title: String,
    back: String
  },
  methods: {
    goBack () {
      if (this.back) {
        this.$router.go(-1)
      }
    }
  }
}
// url() no-repeat
// url()
</script>
<style lang="scss">
.app-title{
  text-align: center;
  overflow: hidden;
  &-left{
    position: absolute;
    top: 0;
    bottom: 0;
    height: 100%;
    line-height: 4.5;
  }
  &-middle{
    color: #fff;
    font-size: 40px;
  }
}
</style>
